var { appHelper } = require("../helper");

Wang.main = function (min) {
  min = Number(min) || 2;
  if (isNaN(min)) {
    min = 2;
  }
  console.log(`min:${min}`);
  //1*8 = 8
  //1.5*8 = 12       20

  //
  var appNames = [
    "抖音",
    "今日头条",
    "抖音商城",
    "有柿",
    "抖音火山版",
    "头条搜索极速版",
    "抖音极速版",
    "悟空浏览器",
  ];
  var length = appNames.length;
  for (var index = 0; index < length; index++) {
    var appName = appNames[index];
    appHelper.launchApp(appName);
    sleep(min * 60 * 1000);
    appHelper.launchApp("auto");
    sleep(2 * 1000);
  }
};
